package com.yl.auth.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yl.auth.entity.Yudingdengji;
import com.yl.auth.mapper.YudingdengjiMapper;
import com.yl.auth.model.vo.ChuYuanQueryVo;
import com.yl.auth.model.vo.RuYuanQueryVo;
import com.yl.auth.model.vo.YudingQueryVo;
import com.yl.auth.service.YudingdengjiService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author yl
 * @since 2023-06-25
 */
@Service
public class YudingdengjiServiceImpl extends ServiceImpl<YudingdengjiMapper, Yudingdengji> implements YudingdengjiService {

    @Resource
    private YudingdengjiMapper yudingdengjiMapper;

    @Override
    public Page<Yudingdengji> selectPage(Page<Yudingdengji> pageParam, YudingQueryVo yudingQueryVo) {
        return yudingdengjiMapper.page(pageParam,yudingQueryVo);
    }

    @Override
    public void publish(Integer id) {
        Yudingdengji yudingdengji = yudingdengjiMapper.selectById(id);
        yudingdengji.setStatus(1);
        yudingdengjiMapper.updateById(yudingdengji);
    }
    @Override
    public void quxiao(Integer id) {
        Yudingdengji yudingdengji = yudingdengjiMapper.selectById(id);
        yudingdengji.setStatus(2);
        yudingdengjiMapper.updateById(yudingdengji);
    }

    @Override
    public Yudingdengji getLaorenYuding(Integer id) {
        return yudingdengjiMapper.getLaorenYuding(id);
    }

    @Override
    public Page<Yudingdengji> getfindAllRuYuan(Page<Yudingdengji> pagePram, RuYuanQueryVo ruYuanQueryVo) {
        return yudingdengjiMapper.getfindAllRuYuan(pagePram,ruYuanQueryVo);
    }

    @Override
    public List<Yudingdengji> findXinRuYuan() {
        return yudingdengjiMapper.findXinRuYuan();
    }

    @Override
    public Page<Yudingdengji> ChuYuanPage(Page<Yudingdengji> pageParm, ChuYuanQueryVo chuYuanQueryVo) {
        return yudingdengjiMapper.ChuYuanPage(pageParm,chuYuanQueryVo);
    }

    @Override
    public List<Yudingdengji> xZChuQing() {
        return yudingdengjiMapper.xZChuQing();
    }
}
